<?php
    header('Content-type: text/plain');
    include_once('../MooDom.php');
	
    //-- Bottom
	$document = new MooDom('
		<html>
			<head></head>
			<body>
				<div id="first"></div>
				<div id="second"></div>
			</body>
		</html>
	');
    $first = $document->body->getElementById('first');
    $second = $document->body->getElementById('second');
	$span = $document->element('span');
	$span->inject($document->body, 'bottom');
	echo $document, "\n\n";
    
    //-- Top
	$document = new MooDom('
		<html>
			<head></head>
			<body>
				<div id="first"></div>
				<div id="second"></div>
			</body>
		</html>
	');
    $first = $document->body->getElementById('first');
    $second = $document->body->getElementById('second');
	$span = $document->element('span');
	$span->inject($document->body, 'top');
	echo $document, "\n\n";
    
    //-- After
	$document = new MooDom('
		<html>
			<head></head>
			<body>
				<div id="first"></div>
				<div id="second"></div>
			</body>
		</html>
	');
    $first = $document->body->getElementById('first');
    $second = $document->body->getElementById('second');
	$span = $document->element('span');
	$span->inject($first, 'after');
	echo $document, "\n\n";
    
    
?>
